#include <iostream>
#include <stack>
#include <stdio.h>
#include <vector>
#include "ReversedList.h"
#include "BinarySearchNormal.h"

#include "Person.h"

using namespace std;

#define MACRO_HOME  "HOME"
#define MACRO_HOME_KEY 10021

static const int CTY = MACRO_HOME_KEY;
static const int * goP = &CTY;
const static int **goPP = &goP;
int temp = 0010101;

int SelectSort(int array[], int size){
    int len = size;
    int min = 0;
    for(int i = 0; i < len - 1; i ++){
        min = i;
        for (int k = i + 1; k < len; k ++){
            if (array[k] < array[min]){
                min = k;
            }
        }
        if(array[i] > array[min]){
            int temp = array[i];
            array[i] = array[min];
            array[min] = temp;
        }
    }
    return 0;
}

string replaceSpace(string s) {
    int len = s.length();
    int index = 0;
    vector<string> strs;
    int spaceCount = 0;
    for(int i = 0; i < len ; i ++, index ++)
    {
        if(s[i] == 32)
        {
            spaceCount ++;
        }
    }
    strs.reserve(spaceCount);
    for (int i = 0; i < spaceCount + 1; ++i)
    {
        strs.push_back("");
    }
    spaceCount = 0;
    for(int i = 0; i < len ; i ++, index ++)
    {
        if(s[i] == 32)
        {
            index = 0;
            strs[spaceCount] += '%';
            strs[spaceCount] += '2';
            strs[spaceCount] += '0';
            spaceCount ++;
        }else
        {
            strs[spaceCount] += s[i];
        }
    }
    string result = "";
    for (int j = 0; j < strs.size(); j ++)
    {
        result = result + strs[j];
    }
    return result;
}


int main() {
//    cout << MACRO_HOME << " " << CTY << " " << goP << " " << endl;
//    cout << goPP << endl;
//    cout << *goP << endl;
//    cout << *goPP << endl;
//    int TT[] = {1,4,5,6,3,22,12,3213,141,1233};
//    SelectSort(TT, 10);
//    Person *pa = new Person();
//    cout << pa->anw() << endl;
//    delete pa;
//    string re = replaceSpace("meng jiang tao");

//    ReversedList * rl = new ReversedList();
//    rl->selfTest();
//    BinarySearchNormal* bs = new BinarySearchNormal();
//    bs->selfTest();
//    stack<int> *s1;
//    s1 = new stack<int>();
//    s1->push(1);

//#include "StackMin.h"
//    StackMin* mm = new StackMin();
//    mm->push(-2);
//    mm->push(0);
//    mm->push(-3);
//    mm->min();
//    mm->pop();
//    mm->top();
//    mm->min();

//#include "TurnLeftStr.h"
//    TurnLeftStr* mm = new TurnLeftStr();
//    mm->selfTest();
    int  arr[] = {1,2,3,4,0,99};
    SelectSort(arr, 6);
    return 0;
}
